-
Notifications
You must be signed in to change notification settings - Fork 641
dataconnect: demo: add support for data connect preview flags and update dependencies #7160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @dconeybe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request enhances the Data Connect demo's Gradle build system by adding support for 'preview flags'. This allows developers to enable experimental or unreleased features of Data Connect during the source generation process by configuring a simple Gradle property, providing greater flexibility for testing and development.
Highlights
- Gradle Task Enhancement: I've extended the
DataConnectGenerateSourcesTask
inbuild.gradle.kts
to accept an optionaldataConnectPreviewFlags
property. This allows for passing specific flags to the Data Connect source generation process. - Environment Variable Integration: The provided
dataConnectPreviewFlags
are now passed as aDATA_CONNECT_PREVIEW
environment variable to the underlying command executed by the Gradle task, enabling the Data Connect emulator or codegen to utilize these flags. - Configuration Property: I've introduced a new Gradle property,
dataConnect.demo.dataConnectPreviewFlags
, which can be set ingradle.properties
or via the command line, to easily configure these preview flags for the demo build. - Documentation and Example: I've added commented-out lines in
gradle.properties
to document the newdataConnect.demo.dataConnectPreviewFlags
property, including an example of how to use it with comma-separated values.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds support for dataConnectPreviewFlags
to the demo project's Gradle build script. The flags are read from gradle.properties
and passed as an environment variable to the Data Connect emulator. The implementation is clear and correct. I've provided one suggestion to use more idiomatic Kotlin for a null check, which will improve code readability and maintainability.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
…`!== null`, which is more idiomatic Java
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request updates various dependencies and introduces support for Data Connect preview flags. The implementation is solid, and I appreciate the refactoring to more idiomatic Kotlin code. I have one minor suggestion regarding a null check to align with Kotlin's coding conventions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for passing Data Connect preview flags through the demo build and updates various dependency and SDK versions.
- Introduce
dataConnectPreviewFlags
ingradle.properties
and wire it through theDataConnectGenerateSourcesTask
. - Bump Gradle plugin, Firebase BOM, Kotlin Coroutines, AndroidX, and compile/target SDK to the latest versions.
- Refactor environment setup and output stream configuration using Kotlin’s null-safe
let
patterns.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
firebase-dataconnect/demo/gradle.properties | Add commented property for configuring preview flags in the demo. |
firebase-dataconnect/demo/build.gradle.kts | Update plugin/library versions, add preview flags support, refactor setup, and bump SDK targets. |
Comments suppressed due to low confidence (3)
firebase-dataconnect/demo/build.gradle.kts:141
- [nitpick] Add KDoc or a comment explaining the purpose of this property and how it maps to the emulator's preview flags to aid future maintainers.
@get:Input @get:Optional abstract val dataConnectPreviewFlags: Property<String>
firebase-dataconnect/demo/build.gradle.kts:141
- Consider adding a test to verify that the preview flags property is correctly read from Gradle properties and passed to the emulator environment.
@get:Input @get:Optional abstract val dataConnectPreviewFlags: Property<String>
firebase-dataconnect/demo/build.gradle.kts:299
- [nitpick] Indentation for this property assignment appears misaligned compared to its surrounding configuration. Align it with adjacent property blocks for readability.
dataConnectPreviewFlags =
/gemini summary |
Summary of ChangesThis pull request primarily focuses on maintaining the Data Connect demo's build environment by updating its dependencies to the latest versions and advancing its Android SDK target. A significant enhancement is the introduction of a mechanism to pass 'preview flags' to the Data Connect emulator and code generation process, enabling the testing and use of experimental features. The changes also include minor code style improvements by adopting more idiomatic Kotlin for null handling. Highlights
Changelog
Activity
|
This PR performs some maintenance of the Data Connect demo application. It introduces a mechanism to pass 'preview flags' to the Data Connect cli, updates the dependencies to the latest versions, and improves some null-handling logic to be more Kotlin-idiomatic.
Highlights
dataConnect.demo.dataConnectPreviewFlags
, allowing the specification of preview flags for the Data Connect emulator and code generation. These flags are passed as aDATA_CONNECT_PREVIEW
environment variable to the Firebase CLI.compileSdk
andtargetSdk
versions from API level 35 to 36.?.let
for improved readability and safety.Changelog
com.android.application
(8.11.0 -> 8.11.1),com.google.gms.google-services
(4.4.2 -> 4.4.3),com.diffplug.spotless
(7.0.0.BETA4 -> 7.1.0),firebase-bom
(33.15.0 -> 33.16.0),kotlinx-coroutines-core
(1.10.1 -> 1.10.2),kotlinx-coroutines-android
(1.10.1 -> 1.10.2),kotlinx-serialization-core
(1.8.1 -> 1.9.0), andandroidx.lifecycle:lifecycle-viewmodel-ktx
(2.9.1 -> 2.9.2).compileSdk
andtargetSdk
versions from 35 to 36.dataConnectPreviewFlags
property to theDataConnectGenerateSourcesTask
(line 141).DataConnectGenerateSourcesTask
to read thedataConnectPreviewFlags
(line 160) and pass them as aDATA_CONNECT_PREVIEW
environment variable to the Firebase CLI during SDK generation (line 237).if (logStream !== null)
tologStream?.let { ... }
(lines 195-197 to 200-202) and similar null checks fornodeExecutableDirectory
anddataConnectEmulatorExecutable
(lines 222-242 to 228-235) to use the more concise and idiomatic Kotlin?.let
syntax.dataConnect.demo.dataConnectPreviewFlags
with a descriptive comment, explaining its purpose for enabling preview features.